import { Dimensions } from 'react-native';

const { width, height } = Dimensions.get('window');

export let vw = width / 100;
export let vh = height / 100;

const updateDimensions = () => {
    const { width, height } = Dimensions.get('window');
    vw = width / 100;
    vh = height / 100;
};

// 添加事件监听
Dimensions.addEventListener('change', updateDimensions);